package com.jdas.trial;

import junit.framework.TestCase;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;

/**
 * Created by IntelliJ IDEA.
 * User: jc40819
 * Date: Sep 13, 2010
 * Time: 10:59:24 AM
 * To change this template use File | Settings | File Templates.
 */
public class TextReaderTest extends TestCase {
     String textString;

    protected void setUp() {
        textString = "This is the text string";
    }

    public void testReadFromFile() {
        try {
            FileWriter blankFile = new FileWriter("dummy.txt");
            BufferedWriter out = new BufferedWriter(blankFile);
            out.write(textString);
            String readInfo = TextReader.readText("dummy.txt");
            assertEquals(readInfo + " does not equal " + textString, readInfo, textString);
            blankFile.close();
            File meow = new File("dummy.txt");
            meow.delete();
        } catch (Exception e)  {

        }
    }
}
